const router = require('koa-router')()
const Audio = require('./controllers/audio')
const Lesson = require('./controllers/lesson')
const User = require('./controllers/user')
const Student = require('./controllers/student')

// router.get('/', async (ctx, next) => {
//   await ctx.render('index', {
//     title: '似乎...您闯入了未知的领域...'
//   })
// })

router.get('/audios/:id',Audio.mainPage)

router.get('/qrcode/:id',Audio.qrcode)

router.get('/upload', Audio.new)


router.get('/upload/:id', Audio.change)

router.post('/login', User.login)
router.post('/checkJwt', User.checkJwt)


router.post('/admin/audio/upload', Audio.upload)

router.post('/admin/lesson/design', Lesson.lesson)

router.get('/lesson/:id', Lesson.design)
router.get('/admin/lesson/new/:id/:jwt', Lesson.new)

router.get('/homework/:id', Lesson.mainPage)

router.post('/student/login', Student.login)
router.post('/student/autoLogin', Student.autoLogin)
router.post('/student/withdraw', Student.withdraw)
router.post('/student/answerRight', Student.answerRight)
router.post('/student/sendArticle', Student.sendArticle)


module.exports = router